import React, { useState, useEffect, Component } from 'react';
import { View, Text, TouchableHighlight } from 'react-native';

export default function WaitSendOrder(props) {
    const [info, setInfo] = useState({})
    const [goods, setGoods] = useState('')

    changeText = () => {
        setGoods('kkkk')
        setInfo({ name: 'jeking', age: 18 })
    }

    useEffect(() => {
        alert('123')
    })

    const {name} = props

    return (
        <View style={{ flex: 1 }}>
            <TouchableHighlight onPress={this.changeText} style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
                <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
                    <Text>{info.name}</Text>
                    <Text>{goods}</Text>
                    <Text>{name}</Text>
                </View>
            </TouchableHighlight>
        </View>
    );
}
